@extends('default.mobile.layouts.personalPublic')
@section('title','创建简历-'.Site::get('webname'))
{{--首页css--}}
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/mobile/personal/common.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/mobile/jquery/select.css')}}">
@endsection
{{--头部标签--}}
@section('tag','创建简历')

{{--主体内容--}}
@section('content')
    <div class="fill" id="fill" style="overflow: hidden">
        <div class="form_info" id="form_info">
            <form action="{{url('mobile/personal/resume_create_post')}}" onsubmit="return checkResumeCreate('#resumeCreateForm')"
                    method="post" id="resumeCreateForm" name="resumeCreateForm">
                {{csrf_field()}}
                <input type="hidden" name="id" id="id"  value="" >
                <dl>
                    <dt>姓名<span class="asterisk">*</span></dt>
                    <dd><input type="text" name="name" id="name"  value="{{ old('name') }}" placeholder="请输入姓名" autocomplete="off"></dd>
                </dl>
                <dl class="arrow" id="sex_select">
                    <input type="hidden" name="sex" value="{{old('sex') }}" id="sex" />
                    <dt>性别<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择性别</span></dd>
                </dl>
                <dl class="arrow" id="birthday_select">
                    <input type="hidden" name="birthday" value="{{ old('birthday') }}" id="birthday" />
                    <dt>出生日期<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择出生日期</span></dd>
                </dl>
                <dl class="arrow" id="education_select">
                    <input type="hidden" name="education" value="{{ old('education') }}" id="education" />
                    <dt>最高学历<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择学历</span></dd>
                </dl>
                <dl class="arrow" id="work_year_select">
                    <input type="hidden" name="work_year" value="{{ old('work_year') }}" id="work_year" />
                    <dt>工作经验<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择工作经验</span></dd>
                </dl>
                <dl class="arrow" id="job_status_select">
                    <input type="hidden" name="job_status" value="{{ old('job_status') }}" id="job_status" />
                    <dt>求职状态<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择求职状态</span></dd>
                </dl>
                <dl class="arrow" id="homeaddress_select">
                    <input type="hidden" name="homeaddress" value="{{ old('homeaddress') }}" id="homeaddress" />
                    <dt>现居地<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择现居地</span></dd>
                </dl>
                <dl>
                    <dt>手机号码<span class="asterisk">*</span></dt>
                    <dd><input type="text" name="mobile" id="mobile"  value="{{ $user->mobile }}" placeholder="请输入手机号码"  autocomplete="off"></dd>
                </dl>
                <dl>
                    <dt>邮箱地址</dt>
                    <dd><input type="text" name="email" id="email"  value="{{$user->email }}" placeholder="请输入邮箱地址"  autocomplete="off"></dd>
                </dl>
                <dl>
                    <dt>QQ号码</dt>
                    <dd><input type="text" name="qq" id="qq"  value="{{ old('qq') }}" placeholder="请输入QQ号码" autocomplete="off"></dd>
                </dl>
                <dl>
                    <dt>详细地址</dt>
                    <dd><input type="text" name="address" id="address"  value="{{ old('address') }}" placeholder="请输入详细地址" autocomplete="off"></dd>
                </dl>
                <dl>
                    <dt>意向岗位<span class="asterisk">*</span></dt>
                    <dd><input type="text" name="intentionjobs" id="intentionjobs"  value="{{ old('intentionjobs') }}" placeholder="请输入意向岗位" autocomplete="off"></dd>
                </dl>
                <dl class="arrow" id="jobarea_select">
                    <input type="hidden" name="jobarea1" value="{{ old('jobarea1') }}" id="jobarea1" />
                    <input type="hidden" name="jobarea2" value="{{ old('jobarea2') }}" id="jobarea2" />
                    <input type="hidden" name="jobarea3" value="{{ old('jobarea3') }}" id="jobarea3" />
                    <input type="hidden" name="jobarea4" value="{{ old('jobarea4') }}" id="jobarea4" />
                    <input type="hidden" name="jobarea5" value="{{ old('jobarea5') }}" id="jobarea5" />
                    <dt>工作地区<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择工作地区</span></dd>
                </dl>
                <dl class="arrow" id="jobsort_select">
                    <input type="hidden" name="jobsort1" value="{{ old('jobsort1') }}" id="jobsort1" />
                    <input type="hidden" name="jobsort2" value="{{ old('jobsort2') }}" id="jobsort2" />
                    <input type="hidden" name="jobsort3" value="{{ old('jobsort3') }}" id="jobsort3" />
                    <input type="hidden" name="jobsort4" value="{{ old('jobsort4') }}" id="jobsort4" />
                    <input type="hidden" name="jobsort5" value="{{ old('jobsort5') }}" id="jobsort5" />
                    <dt>期望职位<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择期望职位</span></dd>
                </dl>
                <dl class="arrow" id="expectedsalary_select">
                    <input type="hidden" name="expectedsalary" value="{{ old('expectedsalary') }}" id="expectedsalary" />
                    <dt>期望薪资</dt>
                    <dd><span class="select_text">请选择期望薪资</span></dd>
                </dl>
                <dl class="arrow" id="census_select">
                    <input type="hidden" name="census" value="{{ old('census') }}" id="census" />
                    <dt>户籍地址</dt>
                    <dd><span class="select_text">请选择户籍地址</span></dd>
                </dl>
                <dl class="arrow" id="marital_select">
                    <input type="hidden" name="marital" value="{{ old('marital') }}" id="marital" />
                    <dt>婚姻状况</dt>
                    <dd><span class="select_text">请选择婚姻状况</span></dd>
                </dl>
                <dl>
                    <dt>身高</dt>
                    <dd><input type="text" name="height" id="height" value="{{ old('height') }}" placeholder="请输入身高"  autocomplete="off"></dd>
                </dl>
                <dl class="arrow" id="introduction_description">
                    <dt>自我评价</dt>
                    <dd>
                        <textarea name="introduction" id="introduction" style="display: none;">{{ old('introduction') }}</textarea>
                        <span class="select_text">请填写自我评价</span>
                    </dd>
                </dl>
                <dl>
                    <dt>简历名称</dt>
                    <dd><input type="text" name="resume_name" id="resume_name"  value="我的简历" placeholder="请输入简历名称" autocomplete="off"></dd>
                </dl>
                <div class="form_sub"><input type="submit" value="保存"></div>
            </form>
        </div>
    </div>

@endsection

@section('footerjs')
    @parent
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select_single.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select_time.js')}}"></script>
    <script type="text/javascript" src="{{Resources::jsOption('resume')}}"></script>
    <script type="text/javascript" src="{{Resources::jsProvinceArea()}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select_many.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select_position.js')}}"></script>
    <script type="text/javascript" src="{{Resources::jsOption(['expectedsalary'])}}"></script>
    <script type="text/javascript" src="{{Resources::jsOnePosition()}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.textarea.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/personal/my_resume.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/zepto.scroll.js')}}"></script>

    <script>
        var _token =  '{{csrf_token()}}';
        $(function(){
            var fill = $("#fill").find('#form_info');
            //性别
            var option_sex = [{text:'男',value:1},{text:'女',value:2}];
            fill.find("#sex_select").select({
                select_title:'性别',
                hidden: '#sex',
                opt_data:option_sex
            });

            //出生日期
            fill.find("#birthday_select").select_time({
                select_title:'出生日期',
                hidden: '#birthday'
                //toDate:true
            });
            //工作经验
            fill.find("#work_year_select").select({
                select_title:'工作经验',                //标题值
                hidden: '#work_year',                   //select隐藏表单值
                opt_data:option_work_year               //select选项值（数组json对象）
            });
            //学历
            fill.find("#education_select").select({
                select_title:'最高学历',
                hidden: '#education',
                opt_data:option_education
            });

            //求职状态
            fill.find("#job_status_select").select({
                select_title:'求职状态',
                hidden: '#job_status',
                opt_data:option_job_status
            });

            //婚姻状况
            fill.find("#marital_select").select({
                select_title:'婚姻状况',
                hidden: '#marital',
                opt_data:option_marital
            });
            //单列选项地区选择
            fill.find("#homeaddress_select").select_single({
                select_title:'现居地',
                hidden: '#homeaddress',
                opt_city: (typeof(option_city) != 'undefined') ? option_city : [],
                opt_province:option_province
            });

            //单列户籍地区选择
            fill.find("#census_select").select_single({
                select_title:'户籍',
                hidden: '#census',
                opt_city: (typeof(option_city) != 'undefined') ? option_city : [],
                opt_province:option_province
            });
            //期望薪资
            option_expectedsalary.unshift({'value':0,'text':'面议'});
            fill.find("#expectedsalary_select").select({
                select_title:'期望薪资',                //标题值
                hidden: '#expectedsalary',               //select隐藏表单值
                opt_data:option_expectedsalary          //select选项值（数组json对象）
            });

            //多选工作地区选择
            fill.find("#jobarea_select").select_many({
                select_title:'工作地区',
                selectArr: ['#jobarea1','#jobarea2','#jobarea3','#jobarea4','#jobarea5'],
                opt_city: (typeof(option_town) != 'undefined') ? option_town_second : (typeof(option_city) != 'undefined') ? option_city_two : [],
                opt_province:option_province,
            });
            //多选职位选择
            fill.find("#jobsort_select").select_position({
                select_title:'职位类别',
                selectArr: ['#jobsort1','#jobsort2','#jobsort3','#jobsort4','#jobsort5'],
                opt_position:option_position
            });
            //点击自我评价
            fill.find("#introduction_description").textarea({
                text_title:'自我评价',
                hidden: '#introduction'
            });
        });

        //错误信息提示
        @if(count($errors)>0)
            @if(is_object($errors))
                var msgErr='';
                @foreach($errors->all() as $error)
                        msgErr += "<p style='line-height: .4rem; width: 100%'>{{$error}};</p>";
                @endforeach
                layerMsg(msgErr,2);
            @endif
        @endif
    </script>
@endsection